package com.iflytek.uc.service;

import java.util.List;

import com.iflytek.uc.domain.Account;
import com.iflytek.uc.domain.AuthorizationCode;
import com.iflytek.uc.domain.Party;
import com.iflytek.uc.domain.Resource;
import com.iflytek.uc.exceptions.DuplicateKeyException;
import com.iflytek.uc.exceptions.InsufficientPermissionException;

public interface AuthorizationService {

	void addAuthorization(Account executor, 
			Party party, 
			Resource resource, 
			char code) throws InsufficientPermissionException;
	
	void removeAuthorization(Account executor, 
			Party party, 
			Resource resource, 
			char code) throws InsufficientPermissionException;

	String getAuthorization(Party party, Resource resource);
	
	List<AuthorizationCode> getAuthorizationCodes();
	
	AuthorizationCode addAuthorizationCode(char code, 
			String name, 
			int displayOrder) throws DuplicateKeyException;

	AuthorizationCode updateAuthorizationCode(char code, 
			String name, 
			int displayOrder) throws DuplicateKeyException;
	
	void deleteAuthorizationCode(char code);
}
